<?php if (!defined('THINK_PATH')) exit();?><html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>Ajax 文件上传</title>
		<style>
			#imgUpload {
				border: 1px solid #CCC;
				background: #eee;
				width: 500px;
				height: 300px;
				line-height: 300px;
				text-align: center;
			}
			#loga {
				width: 500px;
				height: auto;
				border: 1px solid #999;
				font-size: 13px
			}
			#div_img {
				width: 98%;
				height: auto
			}
		</style>

	</head>
	<body>
		<p>
			&nbsp;
		</p>
		<div id="div_img"></div>
		<p>
			&nbsp;
		</p>
		<p>
			&nbsp;
		</p>
		<center>
			<div>
				<div id="imgUpload">
					把需要上传的文件拖拽到这里
				</div>
			</div>
			<div id="loga" align="left"></div>
			<p>
				&nbsp;
			</p>
			<form id="uploadForm">
				<input type="file" class="upfile"/>
				<input  type="button" value="上传" id="upload">
			</form>
		</center>
		
		<script src="/resume/Public/js/upload.js"></script>
		<script type="text/javascript">
			

			// $("#upload").click(function() {
				// var fileData = new FormData($("#uploadForm")[0]);
				// $.ajax({
					// url : 'http://127.0.0.1:8080/resume/index.php/Home/Index/upload/uploadFile',
					// type : 'POST',
					// data : fileData,
					// async : false,
					// cache : false,
					// contentType : false,
					// processData : false,
					// success : function(returndata) {
						// alert(123+returndata);
					// },
					// error : function(returndata) {
						// alert(returndata);
					// }
				// });
			// });
			window.onload = function() {
				if (window.FileReader) {
					setTimeout(function() {
						var fl = /[*]*(.jpg|.JPG|.gif|.GIF|.png|.PNG|.jpeg|.JPEG|.bmp|.BMP)/;
						var upload = new XHRUpload({
							url : "uploadFile",
							name : "imgFile",
							element : $('imgUpload'),
							formate : fl
						});
						upload.onMsg = function(msg) {
							$('loga').innerHTML += '<br>' + msg;
						};
					}, 500);
				} else {
				}
			};
		</script>
	</body>
</html>